#ifndef STATEMAIN_H
#define STATEMAIN_H

#include "state.h"
#include "stateid.h"
#include "state_normal.h"
#include "state_emergency.h"
#include "../eventmanager.h"


namespace state {
	

struct Main : public State {
	Main() : State() {
		State *normal = new Normal();
		State *emergency = new Emergency(stateid::EMERGENCY);
		
		setInitial(normal);

		normal->addTransition(evt_cmd_emergency, emergency);
		normal->addTransition(-evt_parachute_alt, emergency);
		normal->addTransition(-evt_critical_failure, emergency);
		
		emergency->addTransition(evt_cmd_abort, normal);
		emergency->addTransition(evt_cmd_auto, normal);
	}

	virtual void onEnter() {}
};



}

#endif
